"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.genOnceData = undefined;

var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require("babel-runtime/helpers/createClass");

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OnceData = function () {
    function OnceData() {
        (0, _classCallCheck3.default)(this, OnceData);
        this.data = {};
    }

    (0, _createClass3.default)(OnceData, [{
        key: "set",
        value: function set(key, data) {
            return this.data[key] = data;
        }
    }, {
        key: "get",
        value: function get(key) {
            var data = this.data[key];
            delete this.data[key];
            return data;
        }
    }, {
        key: "has",
        value: function has(key) {
            return key in this.data;
        }
    }]);
    return OnceData;
}();

var genOnceData = exports.genOnceData = function genOnceData() {
    return new OnceData();
};
exports.default = genOnceData;